package com.gsafety.wellsfort.common.enums;

import lombok.Getter;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author: tangjiawei
 * @Date: 2020/4/27
 * @Description
 */
@Getter
public enum RedisPrefixEnum {
    CAPTCHA_PREFIX("captcha_prefix_", "图形验证码前缀", null),
    SMS_CAPTCHA_PREFIX("sms_captcha_prefix_", "短信验证码前缀", 5 * 60L),
    PHONE_SEND_COUNT_PREFIX("sms_phone_send_count_" + new SimpleDateFormat("yyyyMMdd").format(new Date()) + "_prefix_", "手机号短信发送次数,统计维度一天", 1 * 60 * 60 * 24L),
    IP_OPERATOR_PREFIX("ip_operator_" + new SimpleDateFormat("yyyyMMdd").format(new Date()) + "_prefix_", "ip操作限制,统计维度一天", 1 * 60 * 60 * 24L),
    COURSE_VISIT_COUNT_PREFIX("course_detail_count_", "课程访问统计", null),
    COURSE_VISIT_COUNT_By_DATE_PREFIX("course_detail_count_" + new SimpleDateFormat("yyyyMMdd").format(new Date()), "课程访问统计", null),
    ACTIVE_VISIT_COUNT_By_DATE_PREFIX("active_student_count_" + new SimpleDateFormat("yyyyMMdd").format(new Date()), "每日活跃用户统计", null),
    VISIT_SYSTEM_COUNT("visit_system_count", "访问系统次数统计", null),
    ACCOUNT_TOKEN_UNIQUE("account_token_unique_hash", "登录账号token", 8 * 60 * 60L);
    private String prefix;
    private String desc;
    /**
     * 过期时间,单位s
     */
    private Long expireTime;

    private RedisPrefixEnum(String prefix, String desc, Long expireTime) {
        this.prefix = prefix;
        this.desc = desc;
        this.expireTime = expireTime;
    }
}
